#!/bin/bash

# 重启脚本
DEPLOY_HOME=/usr/local/tomcat8-report-8081

#
source /etc/profile

#
pid=$(ps -ef |grep -v grep |grep $DEPLOY_HOME |awk '{print $2}')
if [ ! -z "$pid" ]; then
    echo '[INFO] tomcat stopping...'
    kill -9 $pid >/dev/null
    sleep 3
    echo '[INFO] tomcat stopped'
fi

echo '[INFO] tomcat starting...'
cd $DEPLOY_HOME/bin
./startup.sh